/**
 * Created by oneminute on 8/18/14.
 */

var ursa = require("ursa");
var fs = require("fs");
var lz = require("../lib/utils/modules")();

var privateKey = ursa.createPrivateKey(fs.readFileSync(__dirname + "/../config/lz.pem"));
var publicKey = ursa.createPublicKey(fs.readFileSync(__dirname + "/../config/lz.pub"));
//lz.Logger.debug(privateKey);

var name = "testingname001";
var encryptedData = publicKey.encrypt(name, "utf8", "base64", ursa.RSA_PKCS1_PADDING);
lz.Logger.debug(encryptedData);
var decryptedData = privateKey.decrypt(encryptedData, "base64", 'utf8', ursa.RSA_PKCS1_PADDING);
lz.Logger.debug(decryptedData);
